Section 6 Customizing Mail and Web TemplatesThe majority of Web interface Web pages and administrative messages sent to subscribers can be customized. Customizing your list’s Web pages and administrative messages creates an individual look and tone for your list. Subscribers will see Web pages and read administrative messages that are specific to your list, containing pertinent information and instructions rather than just generic pages and messages.The template editor allows the site administrator and list owner to customize the majority of the Web Interface Pages and Administrative Messages sent out by LISTSERV. There are two types of templates you can customize – Web and Mail.Web Templates (also referred to as Dynamic Web Templates) control the pages produced by the Web interface. These pages are produced dynamically when they are accessed. What gets displayed by the browser depends on the circumstances and may change depending on who is accessing the interface, which list they are accessing, the settings of that list, and so on.Commands in Web Templates begin with a plus sign "+" and variables begin with an ampersand followed by a plus sign "&+".Mail Templates control text produced by LISTSERV itself. Although generally categorized as mail templates, they actually fall into three different types:• Mail Templates control the contents of email messages sent by LISTSERV. A mail template is a complete email message. Formatting commands are available, substitutions that make sense in the context of the specific message are available, and while other templates may be imbedded with the .IM command, the message is in and of itself ready for LISTSERV to send.• Message Templates supply text that will ultimately be shown to the user. These messages may be included in a mail template; or they may be included in an email sent by LISTSERV in response to LISTSERV commands sent by email to the LISTSERV command address; or they may be returned to the Web interface in response to commands sent through the Web interface. Limited formatting is available.• Message Fragments templates are the lowest level of mail templates. Fragments are pieces of text produced by LISTSERV as parts of other messages or emails. For example, list digests must follow a certain format dictated by the Internet RFCs. Therefore, it is not possible to provide a complete mail template for digests. However, some of the text within the digest is not mandated by the RFCs, and so LISTSERV provides some fragment templates to control these parts, for example MSG_DIGEST_FRAGMENT_DATERANGE1 to control the date range and MSG_DIGEST_FRAGMENT_PREAMBLE1 to control the text preceding the table of contents. Formatting commands are generally not available in fragments.To access the template editor, click on the List Management menu, select Customization, and then select either Web Templates or Mail Templates.Once the template editor has opened, simply select the list and template you want to work with. The template editor also lets you create new template.For more information about customization templates, see the Customization Manual for LISTSERV 15.5 or click on the link(s) located in the Tips section at the bottom of the editor.Many list owners prefer to customize some of the administrative messages sent to subscribers and the main Web page for the list archives. However, it is not necessary to customize any of the templates. Customizing templates can be complex for new users, so it is not covered in depth in this manual. The table below lists some of the templates you will most likely to want to customize.
A template for a message sent to new subscribers, in addition to the standard “signup” message. By default, no welcome message is sent. A template for a message sent to subscribers leaving the list. By default, no farewell message is sent. A standard message sent to all new subscribers, usually with list
instructions. By default, this template is included in both the SIGNUP1 and ADD1 templates. A message sent to new subscribers who have signed on by themselves. By default, includes the $SIGNUP template. A message sent to new subscribers who have been added to the list by the owner. By default, includes the $SIGNUP template. A message sent to users who are trying to sign off a list they are not signed on to or from an address that was not the one used to subscribe with. This message is sent to a subscriber who has been removed from the list by a list administrator. A message sent to a user when their post has been forwarded to a moderator (Send= Editor or subscription is set to REVIEW). A message containing information about the list. Sent to anyone sending the “REVIEW listname” command to LISTSERV. By default includes the non-hidden parts of the list header. Adds a text message to the bottom of each message posted to the list. Usually used for disclaimers, tips, and/or signoff or other instructions. If you plan to send HTML messages through the list, you should also define a BOTTOM_BANNER_HTML template containing the HTML version of the BOTTOM_BANNER. Adds a text message to the top of each message posted to the list.
Usually used for a copyright or short legal warning which absolutely has to be seen by each and every reader. If you plan to send HTML messages through the list, you should also define a TOP_BANNER_HTML template. This message is sent to users who are automatically deleted from the list when delivery errors (bounces) to that address exceed the threshold set by the Auto-Delete= keyword (or its default setting). The main web page for the list archives. This template creates the listname.html file. This is a “static” web template. Requires knowledge of HTML to customize (see below).• Deleting a template in the Web Interface template editor or removing it from the listname.mailtpl file (when customizing by email) will not prevent a message from being sent. It merely deletes the customizations and results in the default message being sent. The way to prevent a message from being sent is to customize the template by inserting the directive “.QQ” on a line by itself. Be careful, if you add “.QQ” to a template that is included in other templates, you will be canceling those templates as well.• Changing the wording of most mail templates is fairly straightforward. Simply be aware of the following:• Variables begin with an ampersand (“&”) and may end with a semicolon. You may remove variables from the text if you do not wish to customize that part of the text. For example, the ADD1 template contains the text “You have been added to the &LISTNAME mailing list (&TITLE) by &MBX(&INVOKER)”. The “&LISTNAME”, “&TITLE”, and “&MBX(&INVOKER)” will be replaced by the list name, title, and the name and email address of the owner that added the subscription. This is easily changed to “You have been added to the &LISTNAME mailing list (&TITLE) by the list owner” if you do not wish to reveal the name and address of the owner.• If an ampersand (“&”) appears in the template text (this includes any URLs with ampersands) it must be doubled (“&&”) in order to keep LISTSERV from treating it like a variable.• Lines starting with a dot (“.”) are template “directives”. Do not make changes to these lines without understanding what they do. See the List Owner manual for LISTSERV for details.• Changing the Web templates requires knowledge of HTML. You cannot edit the Web templates using an HTML editor – the templates contain variables and template directives of which HTML editors are ignorant. If you are proficient at coding HTML, be aware of the following:• The Web templates are not pure HTML. Think of the templates as HTML code generators: a mix of HTML code, template variables (which may include additional HTML code or simple text strings), and template directives that determine which pieces of HTML code will be included in the final HTML page.• Variables in the dynamic Web templates begin with ampersand-plus sign and end with a semicolon (for example: “&+LISTNAME;”).• Variables in the static Web templates begin with just an ampersand. You must double any ampersands that you wish to be passed on to the HTML instead of being interpreted as a template variable. For example:
<a href="/scripts/wa.exe?SUBED1=&LISTNAME&&A=1">
in the WWW_INDEX for the list called MYLIST will result in the following HTML code:
<a href="/scripts/wa.exe?SUBED1=MYLIST&A=1">• Template directives are lines starting with a dot (“.”) in the static Web templates and lines starting with a plus (“+”) in the dynamic Web templates. Do not make changes to these lines without understanding what they do.• You may create your own dynamic Web templates. The beginning of the template should look like:The first line is required (or else the page will not display), the following two are optional but recommended.To display the template, call the Web interface script with the parameters SHOWTPL=templatename&L=listname. For example:http://listserv.example.com/scripts/wa.exe?SHOWTPL=MYTPL&L=MYLIST